/**  
* @Title:  AdvanceIOUtils.java
* @Package com.hugedata.cdnserver.util
* @Description: TODO(用一句话描述该文件做什么)
* @author wangxiaoming
* @date  Sep 29, 2014 10:58:13 AM
* @version V1.0  
* Update Logs:
* ****************************************************
* Name:
* Date:
* Description:
******************************************************
*/
package com.hugedata.cdnserver.util;

import java.io.Closeable;
import java.io.IOException;

import org.apache.zookeeper.common.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @ClassName: AdvanceIOUtils
 * @Description: IO enhance tools
 * @author wangxiaoming
 * @date Sep 29, 2014 10:58:13 AM
 *
 */
public class AdvanceIOUtils extends IOUtils
{
    private static final Logger LOGGER = LoggerFactory.getLogger(AdvanceIOUtils.class);
    
    /**
     * 
    * @Title: closeAllStream
    * @Description: close all in closeables
    * @author wangxiaoming
    * @param closeables
    * @throws
     */
    public static void closeAllStream(Closeable... closeables)
    {
        for (Closeable c : closeables)
        {
            if (c != null)
            {
                try
                {
                    c.close();
                }
                catch (IOException e)
                {
                   LOGGER.warn("Exception in closing " + c, e);
                }
            }
        }
    }
}
